import axios from "axios";

export function getTodaySentence() {
  return axios.get("https://api.wrdan.com/hitokoto");
}

export function queryHackerNews(query: string) {
  return axios.get(`https://hn.algolia.com/api/v1/search?query=${query}`);
}

export function queryHackerNewsError(query: string): any {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      reject();
    }, 2000);
  });
}
